package org.springblade.modules.admin.vo.plan;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.modules.admin.enums.TaskStatusEnum;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @Author ysq
 * @Date 2025/03/24
 * @Description 今日工单列表
 */
@Data
public class TodayTaskListVO {

	@ApiModelProperty(value = "工单id")
	private Long planId;

	@ApiModelProperty(value = "工单类型")
	private Integer typeStatus;

	@ApiModelProperty(value = "计划时间")
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
	@JsonFormat(pattern = DateUtil.PATTERN_DATE)
	private Date planDate;

	@ApiModelProperty(value = "项目id")
	private Long buildingId;

	@ApiModelProperty(value = "项目名称")
	private String buildingName;

	@ApiModelProperty(value = "电梯id")
	private Long elevatorId;

	@ApiModelProperty(value = "电梯名称")
	private String elevatorAddress;

	@ApiModelProperty(value = "状态")
	private Integer status;

	@ApiModelProperty(value = "状态描述")
	private String statusDesc;

	@ApiModelProperty(value = "创建时间")
	private Date createTime;

	@ApiModelProperty(value = "报警人")
	private String alarmUser;

	@ApiModelProperty(value = "报警人电话")
	private String alarmUserPhone;

	public String getStatusDesc() {
		if (this.status != null) {
			return TaskStatusEnum.getTaskName(this.typeStatus, this.status);
		}
		return statusDesc;
	}
}
